declaring multiple variables in javascript based on the quantity of children